<?php
/* @var $this BeritaController */
/* @var $model Berita */
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('agenda-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<!--<h1>Daftar Berita</h1>-->

            
<?php /*$this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'cni-berita-grid',
	'dataProvider'=>$model,
    'enablePagination'=>true,
    'enableSorting'=>true,
    'cssFile' => Yii::app()->baseUrl .'/css/styles-grid-admin.css',
//	'filter'=>$model,
	'columns'=>array(
        array(
            'header' => 'No.',
            'name' => 'parent_id',
            'type' => 'raw',
            'value' => '$data["no"]'
        ),
        array(
            'header' => 'Kategori',
            'name' => 'parent_id',
            'type' => 'raw',
            'value' => '$data["kategori"]'
        ),
        array(
            'header' => 'Nama',
            'name' => 'nama',
            'type' => 'raw',
            'value' => 'l(e($data["nama"]),url("/backend/berita/update/".$data["id"]))'
        ),
        array(
            'header' => 'Status',
            'name' => 'status',
            'type' => 'raw',
            'value' => 'l(e($data["status"] == 1 ? "publish" : "unpublish"),
                url("/backend/berita/ubahstatus/".$data["id"]))'
        ),
        /aa*aa'kategori',
        'nama',
        'isi',
        tatus',
        'tgl_buat',
        'tgl_update',
        'ip_update',
        aa*aa/

	),
)); */?>


<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'berita-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		'id',
		'nama',
		//'keterangan',
        array(
            'header' => 'Isi',
            'name' => 'isi',
            'type' => 'html',
//            'value' => 'CHtml::encode($data["nama_halaman"])'
            'value' => 'u::break_words ($data["isi"],500,"")'
        ),
	    //'tgl_buat',
        array(
            'header' => 'Tanggal Buat',
            'name' => 'tgl_buat',
            'type' => 'raw',
             'value' => 'sql2date($data["tgl_buat"],"dd-mm-yy")'
        ),
		/*
		'tanggal',
		'status',
		*/
		array(
			'class'=>'CButtonColumn',
		),
	),
)); ?>
